def dz(n, m):
    x = (4*n-m)//2
    y = (m-2*n)//2
    if m % 2 == 0 and x >= 0 and y >= 0:
        return x, y
    else:
        return "No answer"


def main():
    a = int(input())
    for i in range(a):
        n, m = map(int, input().split())
        print(dz(n, m))


main()
